home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / zvt1_11u.lha / ZVT / ExampleScripts / ViewFax.rexx < prev   
OS/2 REXX Batch file  |  1995-09-05  |  1KB  |  75 lines

  1. /* Script For Viewing GPFax-Document from ZVT    */
  2.  
  3. options results
  4.  
  5. signal on halt
  6. signal on syntax
  7. signal on break_c
  8.  
  9. options failat 50
  10.  
  11. say "ARexx-script for viewing GPFax-Document from ZVT"
  12. say ""
  13.  
  14. /*
  15.  * Gets the file name connected to the currently selected entry.
  16.  * (There IS an entry selected, otherwise this script isn't called.)
  17.  */
  18.  
  19. ADDRESS zvt.1 getname
  20.  
  21. file = result
  22.  
  23. /*
  24.  * Processing is as similar as in FaxScript.rexx
  25.  */
  26.  
  27. ADDRESS COMMAND "WFP REXX_GPFAX 0"
  28.  
  29. if rc>0 then
  30.     do
  31.         say "Starting GPFax."
  32.         ADDRESS COMMAND "run >nil: <nil: GPFax:GPFax -z -W -NP -Q"
  33.         ADDRESS COMMAND "WFP REXX_GPFAX 30"
  34.         if rc>0 then
  35.             do
  36.                 say "Couldn't start GPFax."
  37.                 exit
  38.             end
  39.         say "Sending ""viewfax " file """ to GPFax."
  40.         ADDRESS rexx_gpfax viewfax file
  41.         say "Quit GPFax."
  42.         ADDRESS rexx_gpfax quitfax
  43.     end
  44.     else
  45.     do
  46.         say "Sending ""viewfax " file """ to GPFax."
  47.         ADDRESS rexx_gpfax viewfax file
  48.     end
  49.  
  50. exit
  51.  
  52.  
  53.  
  54. error:
  55.     call Debug("Error" rc "at line" sigl)
  56.     return rc
  57.  
  58. break_c:
  59. halt:
  60.     call Debug("CTRL_C at line" sigl)
  61.     exit 20
  62.  
  63. syntax:
  64.     call Debug("Syntax error" rc "at line" sigl)
  65.     return rc
  66.  
  67.  
  68. Debug: procedure
  69.     parse arg info
  70.  
  71.     firstLine = sourceline(1)
  72.     parse var firstLine '/*' title '*/'
  73.     say title ':' info
  74.     return
  75.